/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

/* 导航栏样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: #2c3e50;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand h1 {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin: 0 15px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #3498db;
}

.search-container {
    display: flex;
}

#search-input {
    padding: 8px;
    border: none;
    border-radius: 4px 0 0 4px;
}

#search-btn {
    padding: 8px 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* 英雄区域样式 */
.hero {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 4rem 5%;
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

#view-diaries-btn {
    padding: 12px 24px;
    background-color: white;
    color: #3498db;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s;
}

#view-diaries-btn:hover {
    transform: translateY(-3px);
}

/* 日记区域样式 */
.diaries-section {
    padding: 4rem 5%;
}

.diaries-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #2c3e50;
}

.diaries-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.diary-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

.diary-card:hover {
    transform: translateY(-5px);
}

.diary-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.diary-content {
    padding: 20px;
}

.diary-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.diary-date {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.diary-excerpt {
    color: #34495e;
}

/* 关于区域样式 */
.about-section {
    padding: 4rem 5%;
    background-color: #ecf0f1;
}

.about-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #2c3e50;
}

.about-content {
    display: flex;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.profile-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin-right: 40px;
}

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.about-text p {
    margin-bottom: 10px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.diary-date {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.diary-content {
    line-height: 1.8;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 1rem;
    }
    
    .nav-links {
        margin: 15px 0;
    }
    
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-img {
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .diaries-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .nav-links {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-links li {
        margin: 5px 0;
    }
}